<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<include file="Public:meta" />
</head>
<body id="main_page">
<include file="Public:position" />
<div class="container">
    <form enctype="multipart/form-data" method="post" id="frm">
        <div class="table">
           <div class="toolbars">
                <li class="toolbar"><a id="btnSaveAll" href="{$Url}add"  title="添加采集规则" target="_self">添加采集规则</a></li>
                <li class="toolbar"><a id="selectall" onclick="CheckAll()"  title="全选">全选</a></li>
                <li class="toolbar"><a id="del" onclick="batchDel()" title="批量删除">删除</a></li>
            </div>
            <table class="datatable" id="datatable">
                <tr>
                     <th style="width:45px"  nowrap="nowrap">选中</th>
                     <th style="width:55px" >采集ID</th>
                     <th style="width:230px" >采集规则名称</th>
                     <th style="width:130px" >采集数据到频道</th> 
                     
                     <th>备注</th>
                     <th style="width:120px" >创建时间</th>
                     <th style="width:110px" >发布是否需要审核</th>
                    <th style="width:270px;">操作</th>
                </tr>  
                <notempty name="Data">
                <volist name="Data" id="d">
                    <tr>
                        <td><input class="checkrow" type="checkbox" name="id[]" value="{$d.CollectID}" /></td>
                        <td>{$d.CollectID}</td>
                        <td>{$d.CollectName}</td>
                        <td><b>{$d.ChannelID|ChannelName}</b></td>
                        <td  style="text-align:left">{$d.CollectDescription}</td>
                        <td>{$d.CreateTime|strtotime|yd_friend_date}</td>
                        <td>
                            <eq name="d.EnableCheck" value="1">
                                <span class="yes">需要审核</span>
                            <else/>
                                <span class="no">不需要审核</span>
                            </eq>
                        </td>
                        <td class="operator">
                            <a  style="float:left" id="btnSave" href="{$Url}start/id/{$d.CollectID}" target="_self">开始采集数据</a>
                            <div class="btn-sep"></div>
                            <a style="float:left" href="{$Url}modify/id/{$d.CollectID}" id="btnEdit">修改</a>
                            <div class="btn-sep"></div>
                            <a style="float:left" onclick="del({$d.CollectID})" class="btnDel">删除</a>
                        </td>
                    </tr>
                </volist>
                <else/>
                    <tr><td colspan="8" id="NoData">{$Think.lang.NoDataTip}</td></tr>
                </notempty>                                  
            </table>
             <div class="tfoot">
                  <div id="notice">
                        <b>说明：</b><span class="notice-item">不需要审核表示采集的数据已经为审核通过状态</span>
                   </div>
             </div>
        </div>
    </form>
</div>
</body>
</html>
<script type="text/javascript">
function del(id){
	$.confirm("{$Think.lang.DeleteTip}", function () {
		url = "{$Url}del/id/"+id;
		location.href = url;
	}, function () {
		return true;
	});
}

function batchDel(){
	//var arrChk = $("input[name='InfoID[]'][checked]"); //在高速浏览器长度总是返回0
	var arrChk = $("input[name='id[]']");
	var n = 0;
	for(var i = 0; i < arrChk.length; i++){
		if(arrChk[i].checked) n++;
	}
	
	if( n == 0 ) {
		WarnBox("{$Think.lang.CheckDeleteTip}");
		return;
	}
	
	$.confirm("{$Think.lang.DeleteTip}", function () {
		$('#frm').attr("action", "__URL__/del");
		$('#frm').submit();
	}, function () {
		return true;
	});
}
</script>